package com.yootk.client1;
import java.net.*;
public class UDPClient {
    public static  void main(String[] args) throws Exception{
        DatagramSocket client = new DatagramSocket(9999);
        byte data[] = new byte[1024];
        DatagramPacket packet = new DatagramPacket(data,data.length);
        System.out.println("[UDPClient]客户端等待服务端发送信息......");
        client.receive(packet);
        System.out.println("[UDPClient]接受到信息，消息内容为:"+new String(data,0,packet.getLength()));
        client.close();
    }
}
